package com.foreveross.ccjd;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.LinearLayout;
import android.widget.TextView;

import cn.jpush.android.api.JPushInterface;

import com.foreveross.ccjd.chart.CircleView;
import com.foreveross.ccjd.utility.Utils;

public class IndexActivity extends BaseActivity{

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		LinearLayout innerLayout = (LinearLayout) findViewById(R.id.circle_layout_inner);
		LinearLayout outLayout = (LinearLayout) findViewById(R.id.circle_layout_out);
		int dpx = Utils.convertDipOrPx(this, 50);
		TextView innderTv = (TextView) findViewById(R.id.inner_tv);
		TextView outTv = (TextView) findViewById(R.id.out_tv);
		innerLayout.addView(new CircleView(this, dpx/2, 0.65f,innderTv));
		outLayout.addView(new CircleView(this, dpx/2, 0.35f,outTv));
		
		findViewById(R.id.btn_index).setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Intent intent = new Intent(getApplicationContext(),MainActivity.class);
				startActivity(intent);
				
			}
		});
		
	}
	@Override
	protected void onResume() {
		super.onResume();
		JPushInterface.onResume(this);
	}
	@Override
	protected void onPause() {
		super.onPause();
		JPushInterface.onPause(this);
	}
	@Override
	protected int getContentView() {
		return R.layout.index;
	}
}
